﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:OMANE.Modules.PMT" mc:Ignorable="d"
	x:Class="WindowNouveauPMTConfigArbo"
	x:Name="Window"
	Title="Configuration de l'arborescence du nouveau PMT" SizeToContent="WidthAndHeight" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" ShowActivated="True" IsEnabled="True" Topmost="True">

	<Window.DataContext>
        <local:ViewModelNouveauPMTArbo></local:ViewModelNouveauPMTArbo>
    </Window.DataContext>
    <Window.Resources>
    	<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    	<local:BoolToVisibilityInvConverter x:Key="BoolToVisibilityInvConverter"/>
    	<local:TableStateToIconConverter x:Key="TableStateToIconConverter" />
    </Window.Resources>

    <Grid x:Name="LayoutRoot">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
		<GroupBox Margin="10" Header="Dossiers racine" FontWeight="Bold">
			<Grid Margin="10,5">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" MinHeight="25"/>
					<RowDefinition Height="Auto" MinHeight="25"/>
					<RowDefinition Height="10"/>
					<RowDefinition Height="Auto" MinHeight="25"/>
					<RowDefinition Height="Auto" MinHeight="25"/>
				</Grid.RowDefinitions>
				<TextBlock TextWrapping="Wrap" Text="Racine des tables en provenance de l'infocentre :" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,10,0"/>
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="1">
					<Image Source="{Binding ExistsRacineInfocentre, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}" Width="16" VerticalAlignment="Center" d:LayoutOverrides="Width" Margin="0"/>
					<Button Content="Créer" VerticalAlignment="Center" FontWeight="Normal" Visibility="{Binding ExistsRacineInfocentre, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}" Margin="5,0,0,0" Command="{Binding OnCreerClick, Mode=OneWay}" CommandParameter="{Binding NomRacineInfocentre, Mode=OneWay}"/>
					<Button Content="Modifier" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Normal"/>
				</StackPanel>
				<Border BorderBrush="Black" BorderThickness="1" Margin="0" Grid.Row="1" Grid.ColumnSpan="2">
					<TextBlock TextWrapping="Wrap" Text="{Binding NomRacineInfocentre, Mode=OneWay}" VerticalAlignment="Center" FontWeight="Normal"/>
				</Border>
				<TextBlock TextWrapping="Wrap" Text="Racine des tables de paramétrage :" VerticalAlignment="Center" Grid.Row="3" Margin="0,0,82.96,0" d:LayoutOverrides="Width" HorizontalAlignment="Left"/>
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="3" Grid.Column="1"><Image Source="{Binding ExistsRacineParametre, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}" Width="16" VerticalAlignment="Center" d:LayoutOverrides="Width" Margin="0"/><Button Content="Créer" VerticalAlignment="Center" FontWeight="Normal" Visibility="{Binding ExistsRacineParametre, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}" Margin="5,0,0,0" Command="{Binding OnCreerClick, Mode=OneWay}" CommandParameter="{Binding NomRacineParametres, Mode=OneWay}"/><Button Content="Modifier" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Normal"/></StackPanel>
				<Border BorderBrush="Black" BorderThickness="1" Margin="0" Grid.Row="4" Grid.ColumnSpan="2">
					<TextBlock TextWrapping="Wrap" Text="{Binding NomRacineParametres, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Normal"/>
				</Border>
			</Grid>
		</GroupBox>
		<GroupBox Header="Tables du flux" Grid.Row="1" VerticalAlignment="Top" Margin="10" FontWeight="Bold">
			<Grid Margin="10,5">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition Height="25"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="10"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="10"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="10"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="10"/>
					<RowDefinition Height="25"/>
					<RowDefinition Height="25"/>
				</Grid.RowDefinitions>
				<TextBlock TextWrapping="Wrap" Text="Historique du CRT :" VerticalAlignment="Center" d:LayoutOverrides="HorizontalAlignment" HorizontalAlignment="Left" Margin="0,0,10,0" Padding="0,0,10,0"/>
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Column="1">
					<Image Source="{Binding ExistsTbleFluxHistoCRT, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}" Width="16" VerticalAlignment="Center" d:LayoutOverrides="Width" Margin="0" Visibility="{Binding ExistsTbleFluxHistoCRT, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}"/>
					<Button Content="Créer" VerticalAlignment="Center" FontWeight="Normal" Margin="5,0,0,0" Command="{Binding OnCreerClick, Mode=OneWay}" CommandParameter="{Binding NomTbleFluxHistoCRT, Mode=OneWay}" Visibility="{Binding ExistsTbleFluxHistoCRT, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}"/>
					<Button Content="Modifier" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Normal"/>
				</StackPanel>
				<Border BorderBrush="Black" BorderThickness="1" Margin="0" Grid.Row="1" Grid.ColumnSpan="2">
					<TextBlock TextWrapping="Wrap" Text="{Binding NomTbleFluxHistoCRT, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Normal"/>
				</Border>
				<TextBlock TextWrapping="Wrap" Text="Historique du PMT :" VerticalAlignment="Center" d:LayoutOverrides="HorizontalAlignment" HorizontalAlignment="Left" Grid.Row="3" Margin="0,0,10,0" Padding="0,0,10,0"/>
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="3" Grid.Column="1"><Image Source="{Binding ExistsTbleFluxHistoPMT, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}" Width="16" VerticalAlignment="Center" d:LayoutOverrides="Width" Margin="0" Visibility="{Binding ExistsTbleFluxHistoPMT, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}"/><Button Content="Créer" VerticalAlignment="Center" FontWeight="Normal" Margin="5,0,0,0" Visibility="{Binding ExistsTbleFluxHistoPMT, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}" Command="{Binding OnCreerClick, Mode=OneWay}" CommandParameter="{Binding NomTbleFluxHistoPMT, Mode=OneWay}"/><Button Content="Modifier" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Normal"/></StackPanel>
				<Border BorderBrush="Black" BorderThickness="1" Grid.Row="4" Grid.ColumnSpan="2">
					<TextBlock TextWrapping="Wrap" Text="{Binding NomTbleFluxHistoPMT, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Normal"/>
				</Border>
				<TextBlock TextWrapping="Wrap" Text="Taux de commissionnement contractuels :" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="6" Padding="0,0,10,0"/>
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="6" Grid.Column="1"><Image Source="{Binding ExistsTbleFluxTxCom, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}" Width="16" VerticalAlignment="Center" d:LayoutOverrides="Width" Margin="0"/><Button Content="Créer" VerticalAlignment="Center" FontWeight="Normal" Margin="5,0,0,0" Visibility="{Binding ExistsTbleFluxTxCom, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}" Command="{Binding OnCreerClick, Mode=OneWay}" CommandParameter="{Binding NomTbleFluxTxCom, Mode=OneWay}"/><Button Content="Modifier" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Normal"/></StackPanel>
				<Border BorderBrush="Black" BorderThickness="1" Grid.Row="7" Grid.ColumnSpan="2">
					<TextBlock TextWrapping="Wrap" Text="{Binding NomTbleFluxTxCom, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Normal"/>
				</Border>
				<TextBlock TextWrapping="Wrap" Text="Déroulés CBP :" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="9" Padding="0,0,10,0"/>
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="9" Grid.Column="1"><Image Source="{Binding ExistsTbleFluxDerCBP, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}" Width="16" VerticalAlignment="Center" d:LayoutOverrides="Width" Margin="0"/><Button Content="Créer" VerticalAlignment="Center" FontWeight="Normal" Margin="5,0,0,0" Visibility="{Binding ExistsTbleFluxDerCBP, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}" Command="{Binding OnCreerClick, Mode=OneWay}" CommandParameter="{Binding NomTbleFluxDerCBP, Mode=OneWay}"/><Button Content="Modifier" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Normal"/></StackPanel>
				<Border BorderBrush="Black" BorderThickness="1" Grid.Row="10" Grid.ColumnSpan="2">
					<TextBlock TextWrapping="Wrap" Text="{Binding NomTbleFluxDerCBP, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Normal"/>
				</Border>
				<TextBlock TextWrapping="Wrap" Text="Réassurance :" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="12" Padding="0,0,10,0"/>
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="12" Grid.Column="1"><Image Source="{Binding ExistsTbleFluxReass, Converter={StaticResource TableStateToIconConverter}, Mode=OneWay}" Width="16" VerticalAlignment="Center" d:LayoutOverrides="Width" Margin="0"/><Button Content="Créer" VerticalAlignment="Center" FontWeight="Normal" Margin="5,0,0,0" Visibility="{Binding ExistsTbleFluxReass, Converter={StaticResource BoolToVisibilityInvConverter}, Mode=OneWay}" Command="{Binding OnCreerClick, Mode=OneWay}" CommandParameter="{Binding TbleFluxReass, Mode=OneWay}"/><Button Content="Modifier" VerticalAlignment="Center" Margin="5,0,0,0" FontWeight="Normal"/></StackPanel>
				<Border BorderBrush="Black" BorderThickness="1" Grid.Row="13" Grid.ColumnSpan="2">
					<TextBlock TextWrapping="Wrap" Text="{Binding TbleFluxReass, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left" FontWeight="Normal"/>
				</Border>
			</Grid>
		</GroupBox>
		<StackPanel HorizontalAlignment="Right" Grid.Row="2" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="0,5,15,15">
			<Button Content="Valider" HorizontalAlignment="Left" VerticalAlignment="Bottom" Height="25" Width="60" d:LayoutOverrides="GridBox" Margin="0,0,10,0" Visibility="{Binding AllDirectoriesExist, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" Click="Button_Click" />
			<Button Content="Annuler" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="60" Height="25" Click="Button_Click"/>
		</StackPanel>
	</Grid>
</Window>